<%@ page import="com.apexedu.identity.IdConstants" %>
<%@ page import="com.apexedu.identity.entity.TSysUser" %>
<%@ page import="com.apexedu.identity.security.CasLoginUtil" %>
<%@ page import="java.net.URLEncoder" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    // 专给 appcan 移动端用。AppCan首次打开掌上校园，从这个页面跳转到专属的Cas login页面。
    String basePath = request.getScheme() + "://" + request.getServerName();
    if( request.getServerPort()!=80 ){
        basePath += ":" + request.getServerPort();
    }
    basePath += request.getContextPath();
    if(basePath.endsWith("/")==false){
        basePath += "/";
    }
    TSysUser tSysUser = (TSysUser)request.getSession().getAttribute(IdConstants.SESSION_USER);
    if ( tSysUser==null ){
        String casLoginUrl = CasLoginUtil.getCasServerLoginUrl();
        basePath += "s/uc/login";
        casLoginUrl += "?mobile4client=BigScreen&service=" + URLEncoder.encode(basePath, "UTF-8");
        response.sendRedirect( casLoginUrl );
	}else{
        response.sendRedirect( basePath + "s/uc/login" );
	}
%>
